package com.situ.crm2026.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Getter
@Setter
@TableName("courses")
public class Course {

    @TableId(type= IdType.AUTO)
    private Integer id;

    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    @NotBlank(message = "课程名称不能为空")
    private String name;

    //教练
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String coach;

    //教室
    @TableField(condition = SqlCondition.LIKE,whereStrategy = FieldStrategy.NOT_EMPTY)
    private String room;

    //上课时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    //时长
    private String duration;

    //预约人数
    @TableField(exist = false)
    private Integer bookedCount;

    //最大人数
    private Integer maxCapacity;

    //头像
    private String avatar;
    @TableField(exist = false)
    //某课程的某一会员的预约记录ID
   private Integer mcrId;


}
